function snEncStore(key, iv){
	this.key = CryptoJS.enc.Utf8.parse(key || 'whapoksoasfhnume'); //密钥
	this.iv = CryptoJS.enc.Utf8.parse(iv || '0123456'); //ecb用不到
	//AES加密
	this.enc = function(str){
		return CryptoJS.AES.encrypt(str,this.key,{
			iv:this.iv,
			mode: CryptoJS.mode.ECB,
			padding: CryptoJS.pad.Pkcs7
		}).toString();
	}
	//AES解密
	this.dec = function(str){
		return CryptoJS.AES.decrypt(
			str,
			this.key,
			{
				iv:this.iv,
				mode: CryptoJS.mode.ECB,
				padding: CryptoJS.pad.Pkcs7
			}
		).toString(CryptoJS.enc.Utf8);
	}
}
//储存
snEncStore.prototype.setItem = function(key, val){
	window.localStorage.setItem(
		this.enc(key),
		this.enc(JSON.stringify(val))
	)
}
//取值
snEncStore.prototype.getItem = function(key){
	return this.dec(
		window.localStorage.getItem(this.enc(key))
	)
}
//删除
snEncStore.prototype.removeItem = function(key){
	window.localStorage.removeItem(this.enc(key))
}
//清空
snEncStore.prototype.clear = function(){
	window.localStorage.clear();
}